package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.domain.SLearningProgress;
import com.zhentao.result.Result;
import com.zhentao.service.SLearningProgressService;
import com.zhentao.mapper.SLearningProgressMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author song-xinhang
* @description 针对表【s_learning_progress】的数据库操作Service实现
* @createDate 2024-07-28 20:20:20
*/
@Service
public class SLearningProgressServiceImpl extends ServiceImpl<SLearningProgressMapper, SLearningProgress>
    implements SLearningProgressService{
    @Resource
    private SLearningProgressMapper sLearningProgressMapper;

    @Override
    public Result findStage(Integer stageId) {
        // 查询出具体的阶段
        List<SLearningProgress> sLearningProgresses = sLearningProgressMapper.selectList(Wrappers.<SLearningProgress>lambdaQuery().eq(SLearningProgress::getLevelId, stageId));
        return Result.OK(sLearningProgresses);
    }
}




